import java.util.*;
public class two implements jisuanqi{
    public double end(double a1,char s,double a2){
        double m=0;
        if(s=='+'){
            return a1+a2;
        }else if(s=='-'){
            return a1+(-a2);
        }else if(s=='*'){
            m=0;
            for(int i=0;i<a2;i++){
                if(i==0){
                    m=a1;
                    continue;
                }
                m+=a1;
            }
        }else {
            if(a2!=0)
            return a1/a2;
            else System.out.println("傻逼");
            }
        return m;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        two c = new two();
        double a1=0,a2=0;
        char s;
        System.out.println("请先输入你的第一个数");
        a1=sc.nextDouble();
        System.out.println("后面输入符号和数字");
        while(true){

            s=sc.next().charAt(0);
            a2=sc.nextDouble();
            double m=c.end(a1, s, a2);
            a1=m;
            System.out.println(m);
        }
        
    }
}
interface jisuanqi{
    double end(double a1,char s,double a2);
}